package com.ruoyi.base.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.base.mapper.BaseSpecialtyMapper;
import com.ruoyi.base.domain.BaseSpecialty;
import com.ruoyi.base.service.IBaseSpecialtyService;

/**
 * 专业Service业务层处理
 * 
 * @author yepanpan
 * @date 2020-11-09
 */
@Service
public class BaseSpecialtyServiceImpl implements IBaseSpecialtyService 
{
    @Autowired
    private BaseSpecialtyMapper baseSpecialtyMapper;

    /**
     * 查询专业
     * 
     * @param id 专业ID
     * @return 专业
     */
    @Override
    public BaseSpecialty selectBaseSpecialtyById(Long id)
    {
        return baseSpecialtyMapper.selectBaseSpecialtyById(id);
    }
    
    /**
     * 查询专业下拉列表
     * 
     * @param baseSpecialty 专业
     * @return 专业集合
     */
    @Override
    public List<BaseSpecialty> selectList(BaseSpecialty baseSpecialty){
    	return baseSpecialtyMapper.selectList(baseSpecialty);
    }

    /**
     * 查询专业列表
     * 
     * @param baseSpecialty 专业
     * @return 专业
     */
    @Override
    public List<BaseSpecialty> selectBaseSpecialtyList(BaseSpecialty baseSpecialty)
    {
        return baseSpecialtyMapper.selectBaseSpecialtyList(baseSpecialty);
    }

    /**
     * 新增专业
     * 
     * @param baseSpecialty 专业
     * @return 结果
     */
    @Override
    public int insertBaseSpecialty(BaseSpecialty baseSpecialty)
    {
        baseSpecialty.setCreateTime(DateUtils.getNowDate());
        return baseSpecialtyMapper.insertBaseSpecialty(baseSpecialty);
    }

    /**
     * 修改专业
     * 
     * @param baseSpecialty 专业
     * @return 结果
     */
    @Override
    public int updateBaseSpecialty(BaseSpecialty baseSpecialty)
    {
        baseSpecialty.setUpdateTime(DateUtils.getNowDate());
        return baseSpecialtyMapper.updateBaseSpecialty(baseSpecialty);
    }

    /**
     * 批量删除专业
     * 
     * @param ids 需要删除的专业ID
     * @return 结果
     */
    @Override
    public int deleteBaseSpecialtyByIds(Long[] ids)
    {
        return baseSpecialtyMapper.deleteBaseSpecialtyByIds(ids);
    }

    /**
     * 删除专业信息
     * 
     * @param id 专业ID
     * @return 结果
     */
    @Override
    public int deleteBaseSpecialtyById(Long id)
    {
        return baseSpecialtyMapper.deleteBaseSpecialtyById(id);
    }
}
